//
//  Token.h
//  TabulaImaginarius2
//
//  Created by TA2 on 5/23/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "LoadedImages.h"

@interface Token : NSObject <NSCoding> {
	NSString		*tokenImagePath;
	NSString		*tokenId;
	NSArray			*tiledImages;
	CGPoint			origin;
	NSObject		*originLock;
	CGPoint			coordPoint;
	CGPoint			movementOffset;
	CGPoint			startingMoveCoordinate;
    NSString        *protocolId;
    CGLayerRef      idLayer;
}

@property (nonatomic, retain) NSString *tokenImagePath;
@property (nonatomic, readonly) NSArray *tiledImages;
@property (nonatomic) CGPoint startingMoveCoordinate;
@property (nonatomic, readonly) NSString *tokenId;
@property (nonatomic, retain) NSString *protocolId;

+ (NSArray *)tileImage:(UIImage *)image
			 withWidth:(int)width
			withHeight:(int)height;
- (id)initWithImageArray:(NSArray *) images withId:(NSString *)identifier;
- (void)dealloc;
- (void)setOrigin:(CGPoint) point;
- (void)setPoint:(CGPoint) point;
- (CGPoint)getOrigin;
- (CGPoint)getPoint;
- (void)rotateClockwise;
- (void)rotateCounterClockwise;
- (void)setImageArray:(NSArray *) images;
- (CGLayerRef)getImageAtPoint:(CGPoint)point withOffset:(int)offset;
- (CGLayerRef)getIdLayerAtPoint:(CGPoint) point;
- (NSMutableArray *)getPointsWithOffset:(int)offset;
- (void)enterMovingMode:(CGPoint)startingCoordinate;
- (void)leaveMovingMode;
- (void)encodeWithCoder:(NSCoder *)coder;
- (id)initWithCoder:(NSCoder *)coder;

@end
